<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>16_自定义Promise</title>
</head>

<body>
  <script src="./08lib/Promise16.js"></script>
  <script>
  	const p1 = Promise.resolve(2) // 如果是一般值，p1成功，value就是这个值
  	const p2 = Promise.resolve(Promise.resolve(3)) // 如果是成功的promise，p2成功，value是这个promise的value
  	const p3 = Promise.resolve(Promise.reject(4)) // 如果是失败的promise，p3失败，reason是这个promise的reason
  	p1.then(value => {console.log('p1', value)})
  	p2.then(value => {console.log('p2', value)})
  	p3.catch(reason => {console.log('p3', reason)})
  </script>
</body>

</html>